<template>
  <el-dialog :title="$t('query.event.disconnectInfo')" width="35%" :visible.sync="disconnectInfoVisible">
    <el-row>
      <el-col :span="12"><div class="dialog-left-text grid-content">{{$t('query.deviceCode')}}</div></el-col>
      <el-col :span="12"><div class="grid-content" v-text="disconnectData.deviceId"></div></el-col>
    </el-row>
    <el-row>
      <el-col :span="12"><div class="dialog-left-text grid-content">{{$t('query.recordTime')}}</div></el-col>
      <el-col :span="12"><div class="grid-content" v-text="parseTime(disconnectData.recordTime)"></div></el-col>
    </el-row>
    <el-row>
      <el-col :span="12"><div class="dialog-left-text grid-content">{{$t('query.deviceTime')}}</div></el-col>
      <el-col :span="12"><div class="grid-content" v-text="parseTime(disconnectData.deviceTime)"></div></el-col>
    </el-row>
    <el-row>
      <el-col :span="12"><div class="dialog-left-text grid-content">{{$t('query.event.disconnectReason')}}</div></el-col>
      <el-col :span="12"><div class="grid-content" v-text="disconnectReasonFormat(disconnectData.reason)"></div></el-col>
    </el-row>
  </el-dialog>
</template>

<script>
export default {
  name: 'disconnect',
  data() {
    return {
      disconnectData: {
        deviceId: null,
        deviceType: null,
        recordTime: null,
        deviceTime: null,
        reason: null,
      },
      disconnectInfoVisible: false,
    }
  },

  methods: {
    init(data) {
      this.disconnectData = data
      this.disconnectInfoVisible = true
    },

    disconnectReasonFormat(row, column) {
      return row
    },
  },

}
</script>

<style lang="scss" scoped>
.dialog-left-text {
  padding-left: 50px;
  font-weight: bold;
  font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
}
.el-row {
  margin-bottom: 20px;
  &:last-child {
    margin-bottom: 0;
  }
}
.el-col {
  border-radius: 4px;
}
.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.row-bg {
  padding: 10px 0;
}
</style>
